Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check mode for delete operations #422

Open
wants to merge 7 commits into
base: release/1.9.3
Choose a base branch
from

Conversation

Gevorg-Khachatryan-97
Copy link
Contributor

No description provided.

@@ -96,8 +96,15 @@ def delete_image(module, result):
image = Image(module, delete_image=True)
fname = module.params["filename"]
itype = module.params["installer_type"]

if module.check_mode:
result["file_name"] = fname
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need this ? We are already have file name in response messge.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let it be consistent with upload_image()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it should be 'image_name' if required. Add in upload_image() as well.

plugins/modules/ntnx_ndb_databases.py Show resolved Hide resolved
plugins/modules/ntnx_ndb_db_server_vms.py Show resolved Hide resolved
Copy link
Collaborator

@bhati-pradeep bhati-pradeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use "response" for giving check mode msg. Use "msg" for same. As in some modules "response" will have delete spec which is significant in check mode.

@@ -466,6 +466,11 @@ def delete_acp(module, result):
result["error"] = "Missing parameter acp_uuid in playbook"
module.fail_json(msg="Failed deleting acp", **result)

if module.check_mode:
result["acp_uuid"] = acp_uuid
result["response"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update all reviews

Suggested change
result["response"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid)
result["msg"] = "Acp with uuid:{0} will be deleted.".format(acp_uuid)

@bhati-pradeep
Copy link
Collaborator

@alaa-bish @Gevorg-Khachatryan-97 Please add tests to cover added code changes.

@bhati-pradeep bhati-pradeep added the 1.9.3_triage Bug fixes & Improvements label Oct 30, 2023
plugins/modules/ntnx_karbon_clusters_node_pools.py Outdated Show resolved Hide resolved
result["imaged_cluster_uuid"] = cluster_uuid
result["msg"] = "Cluster with uuid:{0} will be deleted.".format(cluster_uuid)
return

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhati-pradeep could not find any test for deletion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhati-pradeep there is no any test for delete stretched vlan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhati-pradeep there is no delete tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bhati-pradeep no test

@abhinavbansal29 abhinavbansal29 self-assigned this Sep 23, 2024
@abhinavbansal29 abhinavbansal29 changed the base branch from main to release/1.9.3 September 23, 2024 11:45
@@ -1499,6 +1499,12 @@ def delete_db_servers(module, result, database_info):
spec = db_servers.get_default_delete_spec(
delete=module.params.get("delete_db_server_vms", False)
)

if module.check_mode:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test missing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have check_sum for delete_db_servers, as we have it for delete_instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.9.3_triage Bug fixes & Improvements 🐍 python
Projects
Development

Successfully merging this pull request may close these issues.

[Imprv] add functionality <functionality_name> to module <module_name>
4 participants